#ifndef FIND_NODE_BY_ID_VISITOR
#define FIND_NODE_BY_ID_VISITOR 1

#include <vector>
#include <string>

#include <osg/NodeVisitor>
#include <osgViewer/Viewer>
class FindNodeByIdVisitor : public osg::NodeVisitor
{
public:
	FindNodeByIdVisitor();
	
	virtual ~FindNodeByIdVisitor();

	virtual void apply(osg::Node& node);
	virtual void apply(osgViewer::Viewer& viewer);
	void setIdString(const std::string& id_string);

	osg::ref_ptr<osg::Node> getFindedNode();
	osg::ref_ptr<osg::Object> getFindedObject();
private:
	std::string _id_string;
	osg::ref_ptr<osg::Node> _finded_node;
	osg::ref_ptr<osg::Object> _finded_obj;
};

#endif //!FIND_NODE_BY_ID_VISITOR